<?php
namespace app\index\validate;
use think\Validate;
class Admin extends Validate
{

    protected $rule=[
        'name'=>'unique:users|require|max:25',
        'password'=>'require|min:6',
    ];

    protected $message=[
        'name.require'=>'用户名称不得为空！',
        'name.unique'=>'用户名称不得重复！',
        'password.require'=>'用户密码不得为空！',
        'password.min'=>'密码不得少于6为！',
    ];

    // protected $scene=[
    //     'add'=>['name','password'],
    //     'edit'=>['name','password'=>'min:6'],
    // ];

}
